﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;


namespace Forum.Entity.Post
{
    public partial class ForumTopicInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "ForumTopic";
        }
        public override string GetInsertSql()
        {
            return "insert into ForumTopic ( [ID], [Name], [BoardID], [InputTime], [MemberID], [MemberName], [LastPostTime], [LastPostID], [LastPosterID], [LastPosterName], [TypeID], [TypeName], [IsDisplay], [ViewCount], [ReplyCount], [TopLevel], [IsEssence]) values ( @ID, @Name, @BoardID, @InputTime, @MemberID, @MemberName, @LastPostTime, @LastPostID, @LastPosterID, @LastPosterName, @TypeID, @TypeName, @IsDisplay, @ViewCount, @ReplyCount, @TopLevel, @IsEssence)";
        }
        public override string GetUpdateSql()
        {
            return "update ForumTopic set  [ID] = @ID, [Name] = @Name, [BoardID] = @BoardID, [InputTime] = @InputTime, [MemberID] = @MemberID, [MemberName] = @MemberName, [LastPostTime] = @LastPostTime, [LastPostID] = @LastPostID, [LastPosterID] = @LastPosterID, [LastPosterName] = @LastPosterName, [TypeID] = @TypeID, [TypeName] = @TypeName, [IsDisplay] = @IsDisplay, [ViewCount] = @ViewCount, [ReplyCount] = @ReplyCount, [TopLevel] = @TopLevel, [IsEssence] = @IsEssence where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 标题
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 版块ID
        /// </summary>
        public Int32 BoardID
        {
            get;
            set;
        }
        /// <summary>
        /// 发表时间
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 会员ID
        /// </summary>
        public Int32 MemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 会员昵称
        /// </summary>
        public String MemberName
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发帖时间
        /// </summary>
        public DateTime LastPostTime
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发帖ID
        /// </summary>
        public Int32 LastPostID
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发贴人ID
        /// </summary>
        public Int32 LastPosterID
        {
            get;
            set;
        }
        /// <summary>
        /// 最后发帖人姓名
        /// </summary>
        public String LastPosterName
        {
            get;
            set;
        }
        /// <summary>
        /// 贴子分类
        /// </summary>
        public Int32 TypeID
        {
            get;
            set;
        }
        /// <summary>
        /// 分类名称
        /// </summary>
        public String TypeName
        {
            get;
            set;
        }
        /// <summary>
        /// 是否审核通过
        /// </summary>
        public Boolean IsDisplay
        {
            get;
            set;
        }
        /// <summary>
        /// 浏览次数
        /// </summary>
        public Int32 ViewCount
        {
            get;
            set;
        }
        /// <summary>
        /// 回复次数
        /// </summary>
        public Int32 ReplyCount
        {
            get;
            set;
        }
        /// <summary>
        /// 置顶级别
        /// </summary>
        public Int32 TopLevel
        {
            get;
            set;
        }
        /// <summary>
        /// 是否精华
        /// </summary>
        public Boolean IsEssence
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "boardid":
                    this.BoardID = (Int32)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "memberid":
                    this.MemberID = (Int32)value;
                    break;
                case "membername":
                    this.MemberName = (String)value;
                    break;
                case "lastposttime":
                    this.LastPostTime = (DateTime)value;
                    break;
                case "lastpostid":
                    this.LastPostID = (Int32)value;
                    break;
                case "lastposterid":
                    this.LastPosterID = (Int32)value;
                    break;
                case "lastpostername":
                    this.LastPosterName = (String)value;
                    break;
                case "typeid":
                    this.TypeID = (Int32)value;
                    break;
                case "typename":
                    this.TypeName = (String)value;
                    break;
                case "isdisplay":
                    this.IsDisplay = (Boolean)value;
                    break;
                case "viewcount":
                    this.ViewCount = (Int32)value;
                    break;
                case "replycount":
                    this.ReplyCount = (Int32)value;
                    break;
                case "toplevel":
                    this.TopLevel = (Int32)value;
                    break;
                case "isessence":
                    this.IsEssence = (Boolean)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "boardid":
                    return this.BoardID;
                case "inputtime":
                    return this.InputTime;
                case "memberid":
                    return this.MemberID;
                case "membername":
                    return this.MemberName;
                case "lastposttime":
                    return this.LastPostTime;
                case "lastpostid":
                    return this.LastPostID;
                case "lastposterid":
                    return this.LastPosterID;
                case "lastpostername":
                    return this.LastPosterName;
                case "typeid":
                    return this.TypeID;
                case "typename":
                    return this.TypeName;
                case "isdisplay":
                    return this.IsDisplay;
                case "viewcount":
                    return this.ViewCount;
                case "replycount":
                    return this.ReplyCount;
                case "toplevel":
                    return this.TopLevel;
                case "isessence":
                    return this.IsEssence;
                default:
                    return null;
            }
        }
    }


}
